1. Field of the Invention
The present invention relates to a method for controlling the process priority in a semaphore operation.
2. Description of the Related Art
In a data processing system capable of executing a multitask process, the exclusive control of resources is performed by the use of semaphore. The semaphore has no concept of the priority. Thus, the priorities of processes are not changed in semaphore operations such as a P operation (an occupying operation) and a V operation (a release operation). Hence, during a period a predetermined process uses a resource by securing the resource by the P operation, if another process having a higher priority is linked to a CPU (central processing unit) loop, all the processes requesting the use of the resource will be placed in the wait state until the resource becomes available.
To avoid such a wait state, the setting of a program has been performed in such a way as to increase the priority of a process before execution of the P operation and decrease it after the execution of the V operation (restore it to the original priority). With this approach, however, there is a need for executing a priority controlling process before and after the execution of the semaphore operation, thus increasing a CPU running (operation) time and degrading the system's performance.
Therefore, to improve the system's performance, a method for controlling the priority of process in the semaphore operation has been desired.